package service

import (
	"context"

	"github.com/mjcode-max/TurboGin/internal/dao"
)

type IRankService interface {
	GetProvinceSkinsList(ctx context.Context, code string) (any, error)
	GetProvinceRankList(ctx context.Context) (any, error) // 新增方法
}

type RankService struct {
	rankDao *dao.RankDAO
}

func (s *RankService) GetProvinceSkinsList(ctx context.Context, code string) (any, error) {
	result, err := s.rankDao.ProvinceSkinsList(ctx, code)
	if err != nil {
		return nil, err
	}

	return result, nil
}

func (s *RankService) GetProvinceRankList(ctx context.Context) (any, error) {

	result, err := s.rankDao.ProvinceRankList(ctx)
	if err != nil {
		return nil, err
	}

	return result, nil
}

func NewRankService() RankService {
	r := dao.NewRankDAO()
	return RankService{rankDao: r}
}
